package com.youlu.campus.admin.wechat;

import com.wechat.pay.java.service.profitsharing.model.AddReceiverResponse;
import com.wechat.pay.java.service.profitsharing.model.DeleteReceiverResponse;
import com.youlu.campus.common.base.QResult;
import com.youlu.campus.wechat.entity.WechatProfitSharingLog;
import com.youlu.campus.wechat.service.WechatProfitSharingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 微信分账
 *
 * @Description: WechatBrandProfitSharingService
 * @Date 2025/10/23
 * @author: su
 */
@RestController
@RequestMapping("/wechat/sharing")
public class WechatProfitSharingController {

    @Autowired
    private WechatProfitSharingService service;


    /**
     * 添加分账接收方
     */
    @PostMapping("/add")
    public QResult<AddReceiverResponse> addReceiver(@RequestBody @Valid WechatProfitSharingLog param) {
        return QResult.success(service.addReceiver(param));
    }

    /**
     * 删除分账接收方
     */
    @PostMapping("/delete")
    public QResult<DeleteReceiverResponse> deleteReceiver(@RequestBody @Valid WechatProfitSharingLog param) {
        return QResult.success(service.deleteReceiver(param));
    }

}